<?php

use think\migration\Migrator;
use think\migration\db\Column;

class BasicProcessType extends Migrator
{
    /**
     * 基本信息 - 工艺类型
     */
    public function change()
    {
        $table = $this->table('basic_process_type');
        $table
            //step:名称
            ->addColumn('name', 'string', ['limit' => 50, 'comment' => '工艺类型名称'])
            ->addColumn('function', 'string', ['limit' => 50, 'comment' => '工艺方法'])
            ->addColumn('region_id', 'integer', ['limit' => 11, 'default' => 53, 'comment' => '区域ID'])
            ->addColumn('delete_time', 'integer', ['limit' => 11, 'default' => 0, 'comment' => '软删除'])

            ->setComment('基本数据 - 工艺类型')
            //引擎
            ->setEngine('InnoDB')
            ->save();
    }

    public function down()
    {
        $this->table('basic_process_type')->drop();
    }
}
